package models;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import play.db.ebean.Model;

@Entity
@Table(name = "ngp_analises")
public class Analises extends Model{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	@Column(name = "ngan_id")
	private Integer id;
	
	@ManyToOne
	@JoinColumn(name = "ngan_usua_id", nullable = false)
	private Usuarios ngp;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "ngan_plne_id")
	private PlanoNegocio planoDeNegocio;
	
	@OneToMany(mappedBy = "analise", fetch = FetchType.LAZY)
	private List<Observacoes> observacoes;

	public Analises() {
		super();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Usuarios getNgp() {
		return ngp;
	}

	public void setNgp(Usuarios ngp) {
		this.ngp = ngp;
	}

	public PlanoNegocio getPlanoDeNegocio() {
		return planoDeNegocio;
	}

	public void setPlanoDeNegocio(PlanoNegocio planoDeNegocio) {
		this.planoDeNegocio = planoDeNegocio;
	}
	
	public List<Observacoes> getObservacoes() {
		return observacoes;
	}

	public void setObservacoes(List<Observacoes> observacoes) {
		this.observacoes = observacoes;
	}

	public static Model.Finder<Integer, Analises> find = new Finder<Integer, Analises>(Integer.class, Analises.class);
	

}
